package com.crm.model.vo.trainingManager;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author yincuimei
 * @Date 2021/9/8 9:05
 */
@Data
public class TrainingDetailVO {
    //主键
    private String trainingId;

    //客户id(客户)
    private String customerId;

    //客户名称(客户)
    private String customerName;

    //客户编号(客户)
    private String customerNumber;

    //会员等级(客户)
    private Integer membershipLevel;

    //会员等级(前端显示)
    private String membershipLevelText;

    //所有人ID(外训所有人ID)--关联账号表
    private String accountId;

    //所有人姓名(外训所有人姓名)
    private String userName;

    //内训负责人ID--关联账号表ID
    private String trainingChargeId;

    //内训负责人姓名
    private String trainingChargeName;

    //返点设置(百分比)
    private Integer rebateSetting;

    private BigDecimal currentRebateAmount;  //目前返点金额

    //会员到期时间(客户)
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date membershipExpirationTm;

    //创建时间
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date createTm;

    //当前状态--0需求分析 1方案报价 2方案报价 3赢单 4输单
    private Integer currentState;

    //当前状态(前端显示)
    private String currentStateText;

    //直接访问链接
    private String accessUrl;

    //附件ID
    private String uploadId;

    public String getCurrentStateText(){
        String currentStateText = "";
        if(currentState != null){
            switch(currentState){
                case 0 :
                    currentStateText = "需求分析";
                    break;
                case 1 :
                    currentStateText = "方案报价";
                    break;
                case 2 :
                    currentStateText = "赢单";
                    break;
                case 3 :
                    currentStateText = "输单";
                    break;
                default :
            }
        }
        return currentStateText;
    }

    public String getMembershipLevelText(){
        String membershipLevelText = "";
        if(membershipLevel != null){
            switch(membershipLevel){
                case 0 :
                    membershipLevelText = "非会员客户";
                    break;
                case 1 :
                    membershipLevelText = "VIP1";
                    break;
                case 2 :
                    membershipLevelText = "VIP2";
                    break;
                case 3 :
                    membershipLevelText = "VIP3";
                    break;
                case 4 :
                    membershipLevelText = "VIP4";
                    break;
                case 5 :
                    membershipLevelText = "VIP5";
                    break;
                default :
                    break;
            }
        }
        return membershipLevelText;
    }
}
